#include "headfiles.h"

using namespace std;

int calcMaxDepth(NODE *root) {
	if (root == NULL) {
		return 0;
	}

	int left_depth = 0;
	int right_depth = 0;
	if (root->left) {
		left_depth = 1 + calcMaxDepth(root->left);
	}

	if (root->right) {
		right_depth = 1 + calcMaxDepth(root->right);
	}

	return (left_depth > right_depth) ? left_depth : right_depth;
}

int calcMinDepth(NODE *root) {
	if (root == NULL) {
		return 0;
	}

	int left_depth = 0;
	int right_depth = 0;
	if (root->left) {
		left_depth = 1 + calcMinDepth(root->left);
	}

	if (root->right) {
		right_depth = 1 + calcMinDepth(root->right);
	}

	return (left_depth < right_depth) ? left_depth : right_depth;
}


